package design.mode.model.strategy.strategy.functiontype.function.renum;

import design.mode.model.strategy.strategy.functiontype.function.strategy.FunctionStrategy;

import java.util.function.Function;
import java.util.function.Predicate;

public enum ReturnHomeStrategy implements FunctionStrategy<String,Integer,String> {
    //"HIGH_RISK".equals(from)：参数校验，function：i->i+"在高风险地区回来的"
    HIGH_RISK(from->"HIGH_RISK".equals(from),i->i+"在高风险地区回来的"),
    MIDDLE_RISK(from->"MIDDLE_RISK".equals(from),i->i+"在中风险地区回来的"),
    LOWER_RISK(from->"LOWER_RISK".equals(from),i->i+"在低风险地区回来的");

    private final Predicate<String> predicate;
    private final Function<Integer,String> function;

    ReturnHomeStrategy(Predicate<String> predicate, Function<Integer, String> function) {
        this.predicate = predicate;
        this.function = function;
    }

    @Override
    public Predicate<String> predicate() {
        return this.predicate;
    }

    @Override
    public Function<Integer, String> function() {
        return this.function;
    }

    public Predicate<String> getPredicate() {
        return predicate;
    }

    public Function<Integer, String> getFunction() {
        return function;
    }
}
